home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / binutils.7 / binutils / binutils-2.7 / bfd / aclocal.m4 < prev    next >
Encoding:
M4 Source File  |  1996-07-04  |  1.2 KB  |  44 lines

  1. dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
  2. AC_DEFUN(BFD_BINARY_FOPEN,
  3. [AC_REQUIRE([AC_CANONICAL_SYSTEM])
  4. case "${host}" in
  5. changequote(,)dnl
  6. i[345]86-*-msdos* | i[345]86-*-go32* | *-*-cygwin32)
  7. changequote([,])dnl
  8.   AC_DEFINE(USE_BINARY_FOPEN) ;;
  9. esac])dnl
  10.  
  11. dnl Get a default for CC_FOR_BUILD to put into Makefile.
  12. AC_DEFUN(BFD_CC_FOR_BUILD,
  13. [# Put a plausible default for CC_FOR_BUILD in Makefile.
  14. AC_REQUIRE([AC_C_CROSS])dnl
  15. if test -z "$CC_FOR_BUILD"; then
  16.   if test "x$cross_compiling" = "xno"; then
  17.     CC_FOR_BUILD='$(CC)'
  18.   else
  19.     CC_FOR_BUILD=gcc
  20.   fi
  21. fi
  22. AC_SUBST(CC_FOR_BUILD)])dnl
  23.  
  24. dnl See whether we need a declaration for a function.
  25. AC_DEFUN(BFD_NEED_DECLARATION,
  26. [AC_MSG_CHECKING([whether $1 must be declared])
  27. AC_CACHE_VAL(bfd_cv_decl_needed_$1,
  28. [AC_TRY_COMPILE([
  29. #include <stdio.h>
  30. #ifdef HAVE_STDLIB_H
  31. #include <stdlib.h>
  32. #endif
  33. #ifdef HAVE_UNISTD_H
  34. #include <unistd.h>
  35. #endif],
  36. [char *(*pfn) = (char *(*)) $1],
  37. bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
  38. AC_MSG_RESULT($bfd_cv_decl_needed_$1)
  39. if test $bfd_cv_decl_needed_$1 = yes; then
  40.   bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  41.   AC_DEFINE_UNQUOTED($bfd_tr_decl)
  42. fi
  43. ])dnl
  44.